using System;
using System.Collections.Generic;
using System.Text;

namespace Common.Utilities.Dispatcher
{
    /// <summary>
    /// 
    /// </summary>
    /// <param name="ticketID"></param>
    /// <param name="workerReference"></param>
    /// <param name="workerType"></param>
    /// <param name="instructionBase"></param>
    public delegate void WorkerStarted(Guid ticketID, IWorker workerReference, Type workerType, InstructionBase instructionBase);

    /// <summary>
    /// 
    /// </summary>
    /// <param name="ticketID"></param>
    /// <param name="workerType"></param>
    /// <param name="instructionBase"></param>
    /// <param name="resultBase"></param>
    public delegate void WorkerFinished(Guid ticketID, Type workerType, InstructionBase instructionBase, ResultBase resultBase);

    /// <summary>
    /// 
    /// </summary>
    /// <param name="ticketID"></param>
    /// <param name="workerType"></param>
    /// <param name="instructionBase"></param>
    /// <param name="workflowName"></param>
    /// <param name="componentName"></param>
    /// <param name="message"></param>
    /// <param name="percent"></param>
    public delegate void WorkerStatusChanged(
        Guid ticketID, Type workerType, 
        InstructionBase instructionBase, 
        string workflowName, string componentName,
        string message, int percent);

    /// <summary>
    /// 
    /// </summary>
    /// <param name="ticketID"></param>
    /// <param name="workerType"></param>
    /// <param name="instructionBase"></param>
    /// <param name="error"></param>
    /// <param name="isFatal">send email notification if fatal error</param>
    public delegate void WorkerHasError(
        Guid ticketID, Type workerType,
        InstructionBase instructionBase, string error, bool isFatal);

    /// <summary>
    /// 
    /// </summary>
    /// <param name="ticketID"></param>
    /// <param name="workerType"></param>
    /// <param name="instructionBase"></param>
    public delegate void WorkerCancelled(Guid ticketID, Type workerType, InstructionBase instructionBase);
}
